package _95MingLing;

import java.util.ArrayList;
import java.util.List;

/**
 * @Broker:
 * @author: ZBoHang 命令调用类
 * @time: 2021/9/16 8:59
 */
public class Broker {

    private List<Order> orderList = new ArrayList<>();

    public void takeOrder(Order order) {
        orderList.add(order);
    }

    public void placeOrder() {
        for (int i = 0, size = orderList.size(); i < size; i++) {
            System.out.print("第" + i + "条命令 --> ");
            orderList.get(i).execute();
        }
        orderList.clear();
    }
}
